home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / Anim / JoinAnim.rx < prev    next >
Text File  |  2001-10-01  |  1KB  |  116 lines

  1. /*     arexx Script 
  2. */
  3.  
  4.     options results
  5.     parse ARG Port b
  6.     
  7.     ADDRESS value Port
  8.  
  9.     pp_GetDepth
  10.     D=result
  11.     pp_GetWidth
  12.     W=result
  13.     pp_GetHeight
  14.     H=result
  15.  
  16.     pp_CountFrames
  17.     count=result
  18.     IF count<2 then DO
  19.         pp_Warn 'Make*an*Anim*first.'
  20.         EXIT
  21.     END
  22.  
  23.     pp_GetCurrentBuffer
  24.     CBf=result
  25.     pp_GetCurrentBrush
  26.     B0=result
  27.  
  28.     pp_FindEmptyBrush
  29.     Brush=result
  30.     if Brush=-1 then DO
  31.         pp_Warn "can't*find*empty|Brush."
  32.         EXIT        
  33.     END
  34.     pp_SetBrush Brush    
  35.  
  36.     pp_BufferGui "*JOIN*CURRENT*ANIM*WITH*"
  37.     flag=result
  38.     IF flag=-1 then DO
  39.         EXIT
  40.     END
  41.  
  42.     pp_SetBuffer flag
  43.     pp_GetWidth
  44.     W2=result
  45.     IF W2=0 then DO
  46.         pp_Warn 'This*Buffer*is*empty.'
  47.         EXIT        
  48.     END
  49.  
  50.     pp_GetHeight
  51.     H2=result
  52.  
  53.     pp_CountFrames
  54.     count2=result
  55.     IF count2<2 then DO
  56.         pp_Warn 'This*Buffer*is*not*an|Animation.'
  57.         EXIT
  58.     END
  59.  
  60.     
  61.     pp_DialogInit 250 80 "*Select*Frames*" 2
  62.         pp_Slider 0 100 5 100 16 "Start*Frame*#" 1 1 count2 1
  63.         pp_Slider 1 100 25 100 16 "End*Frame*#" 1 1 count2 count2
  64.     pp_Dialog
  65.     rc=result
  66.     IF rc=0 THEN DO
  67.             EXIT
  68.     END        
  69.  
  70.     pp_GetDialog 0
  71.     s0=result
  72.  
  73.     pp_GetDialog 1
  74.     s1=result
  75.  
  76.     count2=s1-s0+1
  77.  
  78.     pp_SetBuffer CBf
  79.     pp_GotoFrame count
  80.     pp_AddFrames count2
  81.     pp_CountFrames
  82.     count3=result
  83.  
  84.     pp_ClosestColor 0 0 0
  85.     color=result
  86.     pp_SetBpen color
  87.  
  88.     pp_BrushOpacity 100    
  89.     pp_EffectOff
  90.  
  91.     j=s0
  92.     DO i=count+1 to count3
  93.         pp_SetBuffer flag
  94.         pp_GotoFrame j
  95.         pp_PickBrush 0 0 W2 H2 1
  96.         pp_SetBuffer CBf
  97.         pp_GotoFrame i
  98.         pp_Cls
  99.         pp_plot w/2 h/2
  100.         j=j+1
  101.     END
  102.  
  103.     pp_GotoFrame 1
  104.  
  105.  
  106.  
  107.     pp_FreeBrush
  108.     pp_SetBrush B0
  109.     
  110.     EXIT
  111.     
  112.  
  113.  
  114.     
  115.  
  116.